<?php
/**
 * 车辆类型相关接口请求参数验证器
 * 发仔<i@fazi.me> 2018-07-09
 */

namespace app\open\validate;

use app\base\validate\BaseValidate;

class CartypeValidate extends BaseValidate
{
    protected $rule = [
    ];

    // 默认值
    protected $default = [
        'page' => 1,
        'pagenum' => 20,
        'where_json' => '',
        'fields' => '*',
    ];

    protected $message = [
        'page.isPositiveInt' => '页数只能为正整数',
        'pagenum.isPositiveInt' => '每页数量只能为正整数',
        'fields.isNotEmpty' => '字段不能为空',
        'where_json.isWhereJson' => '不是合法的json字符串',
        'company_ids.checkIDs' => "company_ids 必须为正整数，多个请用','号连接"
    ];

    protected $scene = [
        'list' => ['page' ,'pagenum', 'fields', 'where_json'],
        'add' => [

        ],
        'edit' => [

        ],
        'delete' => [ 'company_ids' ],
    ];
}